'use strict';
var React = require('react');
var ReDoubleLi = require('../../components/pc/ReDoubleLi.jsx');

class ReLiGroup extends React.Component {
    constructor(props) {
        super(props);
        this.renderAllLi = this.renderAllLi.bind(this);
        this.getSpecialClass=this.getSpecialClass.bind(this);
    }

    renderAllLi() {
        if(this.props.reData&&this.props.reData.length>0) {
            var allLi = this.props.reData;
            return allLi.map((item, i)=> {
                return <ReDoubleLi key={"ReDoubleLi"+i} reHref={item.reHref} leftTitle={item.leftTitle}
                                   rightTitle={item.rightTitle}></ReDoubleLi>
            });
        }
    }

    //获取样式
    getSpecialClass(){
        if(this.props.reClass!=undefined){
            return "ReLiGroup "+this.props.reClass;
        }
        else{
            return 'ReLiGroup';
        }
    }

    render() {
        return (
            <ul className={this.getSpecialClass()}>
                {this.renderAllLi()}
            </ul>
        )
    }
}

module.exports = ReLiGroup;